<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Suggestion Details</f:facet>


        <s:decorate id="createDate" template="layout/display.xhtml">
            <ui:define name="label">Create date</ui:define>
            <h:outputText value="#{suggestionHome.instance.createDate}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="rejectDate" template="layout/display.xhtml">
            <ui:define name="label">Reject date</ui:define>
            <h:outputText value="#{suggestionHome.instance.rejectDate}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="seenDate" template="layout/display.xhtml">
            <ui:define name="label">Seen date</ui:define>
            <h:outputText value="#{suggestionHome.instance.seenDate}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/SuggestionEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty suggestionFrom ? 'SuggestionList' : suggestionFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Suggestioninfo</h:panelGroup>
        </f:facet>
    <div class="association" id="suggestioninfoParent">

        <h:outputText value="There is no suggestioninfo associated with this suggestion."
                   rendered="#{suggestionHome.instance.suggestioninfo == null}"/>

        <rich:dataTable var="_suggestioninfo"
                   value="#{suggestionHome.instance.suggestioninfo}"
                rendered="#{suggestionHome.instance.suggestioninfo != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="suggestioninfoTable">
            <h:column>
                <f:facet name="header">Id suggestion info</f:facet>
                <h:outputText value="#{_suggestioninfo.idSuggestionInfo}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Create date</f:facet>
                <h:outputText value="#{_suggestioninfo.createDate}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Info msg</f:facet>
                <h:outputText value="#{_suggestioninfo.infoMsg}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Quality</f:facet>
                <h:outputText value="#{_suggestioninfo.quality}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Last comment date</f:facet>
                <h:outputText value="#{_suggestioninfo.lastCommentDate}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewsuggestioninfo"
                     value="View"
                      view="/Suggestioninfo.xhtml">
                    <f:param name="suggestioninfoIdSuggestionInfo"
                           value="#{_suggestioninfo.idSuggestionInfo}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Request</h:panelGroup>
        </f:facet>
    <div class="association" id="requestParent">

        <h:outputText value="There is no request associated with this suggestion."
                   rendered="#{suggestionHome.instance.request == null}"/>

        <rich:dataTable var="_request"
                   value="#{suggestionHome.instance.request}"
                rendered="#{suggestionHome.instance.request != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="requestTable">
            <h:column>
                <f:facet name="header">Id request</f:facet>
                <h:outputText value="#{_request.idRequest}"/>
            </h:column>
            <h:column>
                <f:facet name="header">City by to city id city</f:facet>
                <h:outputText value="#{_request.cityByToCity.idCity}"/>
            </h:column>
            <h:column>
                <f:facet name="header">State by from state id state</f:facet>
                <h:outputText value="#{_request.stateByFromState.idState}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Country by from country id country</f:facet>
                <h:outputText value="#{_request.countryByFromCountry.idCountry}"/>
            </h:column>
            <h:column>
                <f:facet name="header">User id user</f:facet>
                <h:outputText value="#{_request.user.idUser}"/>
            </h:column>
            <h:column>
                <f:facet name="header">State by to state id state</f:facet>
                <h:outputText value="#{_request.stateByToState.idState}"/>
            </h:column>
            <h:column>
                <f:facet name="header">City by from city id city</f:facet>
                <h:outputText value="#{_request.cityByFromCity.idCity}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Country by to country id country</f:facet>
                <h:outputText value="#{_request.countryByToCountry.idCountry}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Name</f:facet>
                <h:outputText value="#{_request.name}"/>
            </h:column>
            <h:column>
                <f:facet name="header">From lat</f:facet>
                <h:outputText value="#{_request.fromLat}"/>
            </h:column>
            <h:column>
                <f:facet name="header">From lon</f:facet>
                <h:outputText value="#{_request.fromLon}"/>
            </h:column>
            <h:column>
                <f:facet name="header">To lat</f:facet>
                <h:outputText value="#{_request.toLat}"/>
            </h:column>
            <h:column>
                <f:facet name="header">To lon</f:facet>
                <h:outputText value="#{_request.toLon}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Distance</f:facet>
                <h:outputText value="#{_request.distance}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Begin date</f:facet>
                <h:outputText value="#{_request.beginDate}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">End date</f:facet>
                <h:outputText value="#{_request.endDate}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Single day</f:facet>
                <h:outputText value="#{_request.singleDay}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Monday</f:facet>
                <h:outputText value="#{_request.monday}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Tuesday</f:facet>
                <h:outputText value="#{_request.tuesday}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Wednesday</f:facet>
                <h:outputText value="#{_request.wednesday}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Thursday</f:facet>
                <h:outputText value="#{_request.thursday}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Friday</f:facet>
                <h:outputText value="#{_request.friday}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Saturday</f:facet>
                <h:outputText value="#{_request.saturday}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Sunday</f:facet>
                <h:outputText value="#{_request.sunday}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Cron expression</f:facet>
                <h:outputText value="#{_request.cronExpression}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Create date</f:facet>
                <h:outputText value="#{_request.createDate}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Modify date</f:facet>
                <h:outputText value="#{_request.modifyDate}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Delete date</f:facet>
                <h:outputText value="#{_request.deleteDate}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewrequest"
                     value="View"
                      view="/Request.xhtml">
                    <f:param name="requestIdRequest"
                           value="#{_request.idRequest}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
